package com.drools.userguide._1_onlyOneRule;

import org.kie.api.KieServices;
import org.kie.api.runtime.KieContainer;
import org.kie.api.runtime.StatelessKieSession;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

public class Test {

    @org.junit.Test
    public void test() {
        KieServices kieServices = KieServices.Factory.get();
        KieContainer kContainer = kieServices.getKieClasspathContainer();
        StatelessKieSession kSession = kContainer.newStatelessKieSession();
        Applicant applicant = new Applicant("Mr John Smith", 16);
        assertTrue(applicant.isValid());
        kSession.execute(applicant);
        assertFalse(applicant.isValid());
    }
}
